package com.itheima.dao;

import com.itheima.domian.Permission;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface IPermissionDao {

    @Select("select * from Permission  where ID in (select  PERMISSIONID  from role_permission  where roleid = #{roleid} ) ")
    List<Permission>
    findPermissionByRoleId(String roleid)
            throws Exception;

    @Select("select * from Permission")
    List<Permission> findAll() throws Exception;


    @Insert("insert into Permission(permissionName,url) values(#{permissionName},#{url})")
    void save(Permission permission) throws  Exception;
}
